//
//  SignalCountingViewController.h
//  Portable Traffic Signal Assistor
//
//  Created by Ding on 10/19/12.
//  Copyright (c) 2012 TTU. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h> 
#import "Agency.h"
#import "SubSystem.h"
#import "TimingPattern.h"
#import "Intersection.h"
#import "Signal.h"
#import "CustomizedBarButtonItem.h"
#import "SignalPhase.h"
#import "XMLParser.h"
#import "TrafficSignalTimer.h"

@interface SignalCountingViewController : UIViewController
@property (retain, nonatomic) IBOutlet UILabel *signalNameLabel;
@property (retain, nonatomic) IBOutlet UILabel *countingStatusLabel;
@property (retain, nonatomic) IBOutlet UIButton *ring1Button;
@property (retain, nonatomic) IBOutlet UIButton *ring2Button;
@property (retain, nonatomic) IBOutlet UIButton *stopButton;

@property (nonatomic,retain) Agency *agency;
@property (nonatomic,retain) SubSystem *subSystem;
@property (nonatomic,retain) TimingPattern *timingPattern;
@property (nonatomic,retain) Signal *signal;
@property (nonatomic) int timingRing1GraphPositionX;
@property (nonatomic) int timingRing2GraphPositionX;
@property (nonatomic,retain) NSMutableArray *labelList;

@property (nonatomic) float greenTime;
@property (nonatomic) float yellowTime;
@property (nonatomic) float redTime;

@property (nonatomic) int currentRing1PhaseIndex;
@property (nonatomic) int currentRing2PhaseIndex;

@property (nonatomic,retain) NSDate *currentTime;
@property (nonatomic) int offsetPhaseTime;
@property (nonatomic,retain) NSDate *beginTime;
- (IBAction)clickRing1Button:(id)sender;
- (IBAction)clickRing2Button:(id)sender;
- (IBAction)clickStopButton:(id)sender;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil agency:(Agency *)agency subSystem:(SubSystem *) subSystem timingPattern:(TimingPattern *) timingPattern signal:(Signal *) signal;

@end
